{extend name="admin/layout" /}
{block name="app"}
<div class="row">
    <div class="col-xl-12 mt-2">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="/">首页</a></li>
            <li class="breadcrumb-item"><a href="{:url('index')}" data-pjax="true">管理后台</a></li>
            <li class="breadcrumb-item active">网站设置</li>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-sm-12 col-md-6 mt-2">
        <div class="card">
            <div class="card-header">
                网站基本配置
            </div>
            <div class="card-block">
                <form method="post" action="{:url('AdminAjax/config')}" class="ajaxForm">
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">网站名称</span>
                            <input type="text" name="name" class="form-control" placeholder="网站名称"
                                   value="{:config('web_name')}" datatype="s2-30" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">注册邮箱验证</span>
                            <select name="reg_validate" class="form-control">
                                <option value="0">关闭</option>
                                <option value="1" {if condition="config('web_reg_validate')"}selected{/if}>开启</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">注册送币</span>
                            <input type="number" name="reg_coin" class="form-control" placeholder="注册赠送金币"
                                   value="{:config('web_reg_coin')}" datatype="n1-10" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">记录价格</span>
                            <input type="number" name="record_coin" class="form-control" placeholder="每条解析记录价格"
                                   value="{:config('web_record_coin')}" datatype="n1-10" required>
                            <span class="input-group-addon">金币/条</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">保留前缀</span>
                            <textarea class="form-control" name="hold_rr" placeholder="输入你想保留的域名前缀，多个用,隔开">{:config('web_hold_rr')}</textarea>
                        </div>
                        <input class="form-control" placeholder="说明：多个用,隔开" disabled>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-block btn-primary">保存配置</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="col-sm-12 col-md-6 mt-2">
        <div class="card">
            <div class="card-header">
                网站SEO配置
            </div>
            <div class="card-block">
                <form method="post" action="{:url('AdminAjax/config')}" class="ajaxForm">
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">首页标题</span>
                            <textarea class="form-control" name="index_title" placeholder="首页标题">{:config('web_index_title')}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">网站关键词</span>
                            <textarea class="form-control" name="keywords"
                                      placeholder="网站关键词">{:config('web_keywords')}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">网站描述</span>
                            <textarea class="form-control" name="description" placeholder="网站描述">{:config('web_description')}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">首页顶部代码</span>
                            <textarea class="form-control" name="index_head" rows="5" placeholder="首页顶部代码">{:config('web_index_head')}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">底部代码</span>
                            <textarea class="form-control" name="foot" rows="5" placeholder="前台底部代码">{:config('web_foot')}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-block btn-primary">保存配置</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="col-sm-12 col-md-6 mt-2">
        <div class="card">
            <div class="card-header">
                发送邮件邮箱配置
            </div>
            <div class="card-block">
                <form method="post" action="{:url('AdminAjax/config')}" class="ajaxForm">
                    <input type="hidden" name="act" value="email">
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">SMTP服务器</span>
                            <input type="text" name="email_host" class="form-control" placeholder="smtp.qq.com"
                                   value="{:config('web_email_host')}" datatype="*" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">加密方式</span>
                            <input type="text" name="email_security" class="form-control"
                                   placeholder="邮件发送的加密方式，ssl或tls，留空为不加密"
                                   value="{:config('web_email_security')}">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">端口号</span>
                            <input type="number" name="email_port" class="form-control" placeholder="465"
                                   value="{:config('web_email_port')}" datatype="n" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">邮箱账号</span>
                            <input type="text" name="email_username" class="form-control" placeholder="邮箱账号"
                                   value="{:config('web_email_username')}" datatype="*" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">邮箱密码</span>
                            <input type="text" name="email_password" class="form-control"
                                   placeholder="授权密码，QQ邮箱及网易邮箱都不是邮箱登密码"
                                   value="{:config('web_email_password')}" datatype="*" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">发件地址</span>
                            <input type="text" name="email_address" class="form-control"
                                   placeholder="发件地址，可以是邮箱帐号的别名"
                                   value="{:config('web_email_address')}" datatype="*" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">字符编码</span>
                            <input type="text" name="email_charset" class="form-control"
                                   placeholder="发送邮件的字符编码，一般为utf-8或gbk"
                                   value="{:config('web_email_charset')}" datatype="*" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-block btn-primary">保存配置</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

</div>
{/block}